package com.jctrip.hotel.common.enums;

import org.apache.commons.lang3.StringUtils;

import lombok.Getter;

/**
 * 供应商枚举
 */
@Getter
public enum SourceEnum {

    WEHOTEL("WEHOTEL", "锦江"),
    ATOUR("ATOUR", "亚朵"),
    DOSSEN("DOSSEN", "东呈"),
    HWORLD("HWORLD", "华住"),
    HMEIN("HMEIN", "如家"),
    CNBE("CNBE","龙腾捷旅"),
    CNBEINT("CNBEINT","龙腾捷旅国外"),
    ELONGDOM("ELONGDOM","同程艺龙国内"),
    REZEN("REZEN","丽呈"),
    REZENCO("REZENCO","丽呈三方"),
    GREENTREE("GREENTREE","格林豪泰"),
    MTHDOM("MTHDOM","美团")
    ;

    private final String code;
    private final String msg;

    SourceEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static SourceEnum getByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (SourceEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
